wpt_tmp->notes = gbfgetpstr(file_in);
break;
case 6: {
- char* ult = gbfgetpstr(file_in);
+ QString ult = gbfgetpstr(file_in);
link.url_link_text_ = ult;
- if (ult) {
- xfree(ult);
- }
}
break;
case 7: {
- char* id = gbfgetpstr(file_in);
+ QString id = gbfgetpstr(file_in);
wpt_tmp->icon_descr = id;
- if (id) {
- xfree(id);
- }
}
break;
case 8: /* NULL Terminated (vs. pascal) descr */
track = route_head_alloc();
// header option was not set to ignore
if (method !=1) {
- track->rte_name = xstrdup("ATRK XT");
+ track->rte_name = "ATRK XT";
}
track_add_head(track);
}
* The result is a temporary allocated entity: use it or free it!
*/
-char*
+QString
gbfgetpstr(gbfile* file)
{
int len;
}
result[len] = '\0';
- return result;
+ QString r(result);
+ xfree(result);
+ return r;
}
static char*
double gbfgetdbl(gbfile* file); // read a double value
float gbfgetflt(gbfile* file); // read a float value
char* gbfgetstr(gbfile* file); // read until any type of line-breaks or EOF
-char* gbfgetpstr(gbfile* file); // read a pascal string
+QString gbfgetpstr(gbfile* file); // read a pascal string
char* gbfgetcstr(gbfile* file); // read a null terminated string
int gbfputint16(const int16_t i, gbfile* file);
#else
if (strcmp(args, "overview_polyline") == 0) {
#endif
- routehead->rte_name = (char*) xstrdup("overview");
- routehead->rte_desc = (char*) xstrdup("Overview");
+ routehead->rte_name = "overview";
+ routehead->rte_desc = "Overview";
} else {
goog_step++;
xasprintf(&routehead->rte_name, "step%03d", goog_step);
utf_string utf;
utf.is_html = 1;
utf.utfstring = /*QString::fromUtf8*/(instructions);
- routehead->rte_desc = strip_html(&utf);
+ char *s = strip_html(&utf);
+ routehead->rte_desc = s;
+ xfree(s);
instructions = QString();
}
}
wpt_tmp = waypt_new();
wpt_tmp->altitude = alt;
wpt_tmp->shortname = sn;
- wpt_tmp->description = xstrdup(desc);
+ wpt_tmp->description = desc;
wpt_tmp->SetCreationTime(now);
if (latdir == 'S') {